
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>DNS服务器 · AGou's StudyNote</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="AGou">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Frp内网穿透.html" />
    
    
    <link rel="prev" href="OpenSSL、PKI搭建、算法.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"AGou-ops/myStudyNote","types":["star","watch","fork"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://agou-ops.github.io" target="_blank" class="custom-link">◆点击进入我的个人博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.1.</b>
                    
                    关于我
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Program_lang/">
            
                <a href="../Program_lang/">
            
                    
                        <b>1.2.</b>
                    
                    编程语言
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Program_lang/Python.html">
            
                <a href="../Program_lang/Python.html">
            
                    
                        <b>1.2.1.</b>
                    
                    Python
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Program_lang/Java.html">
            
                <a href="../Program_lang/Java.html">
            
                    
                        <b>1.2.2.</b>
                    
                    Java
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../Program_lang/Splash_Lua.html">
            
                <a href="../Program_lang/Splash_Lua.html">
            
                    
                        <b>1.2.3.</b>
                    
                    Splash_Lua
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../Database/">
            
                <a href="../Database/">
            
                    
                        <b>1.3.</b>
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Database/Mysql、MariaDB/README.md">
            
                <span>
            
                    
                        <b>1.3.1.</b>
                    
                    Mysql/MariaDB
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../Database/Mysql、MariaDB/MySQL、MariaDB基础.html">
            
                <a href="../Database/Mysql、MariaDB/MySQL、MariaDB基础.html">
            
                    
                        <b>1.3.1.1.</b>
                    
                    MySQL/MariaDB基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../Database/Mysql、MariaDB/php-mysql.html">
            
                <a href="../Database/Mysql、MariaDB/php-mysql.html">
            
                    
                        <b>1.3.1.2.</b>
                    
                    php-mysql
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Database/MongoDB.html">
            
                <a href="../Database/MongoDB.html">
            
                    
                        <b>1.3.2.</b>
                    
                    MongoDB
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Database/Redis.html">
            
                <a href="../Database/Redis.html">
            
                    
                        <b>1.3.3.</b>
                    
                    Redis
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.4.</b>
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="Linux基础.html">
            
                <a href="Linux基础.html">
            
                    
                        <b>1.4.1.</b>
                    
                    Linux基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="Linux启动流程、内核、grub、模块、内核的编译、anaconda自动化.html">
            
                <a href="Linux启动流程、内核、grub、模块、内核的编译、anaconda自动化.html">
            
                    
                        <b>1.4.2.</b>
                    
                    Linux启动流程、内核、grub、模块等
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="Linux服务器.html">
            
                <a href="Linux服务器.html">
            
                    
                        <b>1.4.3.</b>
                    
                    Linux服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="Linux状态信息.html">
            
                <a href="Linux状态信息.html">
            
                    
                        <b>1.4.4.</b>
                    
                    Linux状态信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="Linux网络客户端工具.html">
            
                <a href="Linux网络客户端工具.html">
            
                    
                        <b>1.4.5.</b>
                    
                    Linux网络客户端工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="Linux网络配置.html">
            
                <a href="Linux网络配置.html">
            
                    
                        <b>1.4.6.</b>
                    
                    Linux网络配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="Linux配置文件.md">
            
                <span>
            
                    
                        <b>1.4.7.</b>
                    
                    Linux配置文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="Linux时间服务器.html">
            
                <a href="Linux时间服务器.html">
            
                    
                        <b>1.4.8.</b>
                    
                    Linux时间服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="Linux日志管理系统.html">
            
                <a href="Linux日志管理系统.html">
            
                    
                        <b>1.4.9.</b>
                    
                    Linux日志管理系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="sudo详解.html">
            
                <a href="sudo详解.html">
            
                    
                        <b>1.4.10.</b>
                    
                    sudo详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="SElinux.html">
            
                <a href="SElinux.html">
            
                    
                        <b>1.4.11.</b>
                    
                    SELinux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="iptables.html">
            
                <a href="iptables.html">
            
                    
                        <b>1.4.12.</b>
                    
                    iptables
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.13" data-path="Linux_shell.html">
            
                <a href="Linux_shell.html">
            
                    
                        <b>1.4.13.</b>
                    
                    Linux Shell
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.14" data-path="shell_awk.html">
            
                <a href="shell_awk.html">
            
                    
                        <b>1.4.14.</b>
                    
                    shell_awk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.15" data-path="OpenSSL、PKI搭建、算法.html">
            
                <a href="OpenSSL、PKI搭建、算法.html">
            
                    
                        <b>1.4.15.</b>
                    
                    OpenSSL、PKI搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.16" data-path="DNS服务器.html">
            
                <a href="DNS服务器.html">
            
                    
                        <b>1.4.16.</b>
                    
                    DNS服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.17" data-path="Frp内网穿透.html">
            
                <a href="Frp内网穿透.html">
            
                    
                        <b>1.4.17.</b>
                    
                    Frp内网穿透
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.18" data-path="Linux其他.md">
            
                <span>
            
                    
                        <b>1.4.18.</b>
                    
                    Linux其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Linux_FileSystem/">
            
                <a href="../Linux_FileSystem/">
            
                    
                        <b>1.5.</b>
                    
                    Linux文件系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Linux_FileSystem/FTP.html">
            
                <a href="../Linux_FileSystem/FTP.html">
            
                    
                        <b>1.5.1.</b>
                    
                    FTP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Linux_FileSystem/SAMBA.html">
            
                <a href="../Linux_FileSystem/SAMBA.html">
            
                    
                        <b>1.5.2.</b>
                    
                    SAMBA
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../Linux_Tools/">
            
                <a href="../Linux_Tools/">
            
                    
                        <b>1.6.</b>
                    
                    Linux工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Linux_Tools/fzf工具.html">
            
                <a href="../Linux_Tools/fzf工具.html">
            
                    
                        <b>1.6.1.</b>
                    
                    fzf工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Linux_Tools/工具集合.html">
            
                <a href="../Linux_Tools/工具集合.html">
            
                    
                        <b>1.6.2.</b>
                    
                    Linux工具集合
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../WEB_Server/">
            
                <a href="../WEB_Server/">
            
                    
                        <b>1.7.</b>
                    
                    网站服务器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../WEB_Server/HTML基础.html">
            
                <a href="../WEB_Server/HTML基础.html">
            
                    
                        <b>1.7.1.</b>
                    
                    HTML基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../WEB_Server/WEB基础.html">
            
                <a href="../WEB_Server/WEB基础.html">
            
                    
                        <b>1.7.2.</b>
                    
                    WEB基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../WEB_Server/httpd.html">
            
                <a href="../WEB_Server/httpd.html">
            
                    
                        <b>1.7.3.</b>
                    
                    httpd/Apache
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../WEB_Server/httpd.conf文件详解.html">
            
                <a href="../WEB_Server/httpd.conf文件详解.html">
            
                    
                        <b>1.7.4.</b>
                    
                    httpd.conf文件详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../WEB_Server/Nginx.html">
            
                <a href="../WEB_Server/Nginx.html">
            
                    
                        <b>1.7.5.</b>
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../WEB_Server/HTTP状态码-详情.html">
            
                <a href="../WEB_Server/HTTP状态码-详情.html">
            
                    
                        <b>1.7.6.</b>
                    
                    HTTP状态码-详情
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../Common_Framework/">
            
                <a href="../Common_Framework/">
            
                    
                        <b>1.8.</b>
                    
                    常用框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../Common_Framework/LNMP.html">
            
                <a href="../Common_Framework/LNMP.html">
            
                    
                        <b>1.8.1.</b>
                    
                    LNMP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../Common_Framework/LAMP.html">
            
                <a href="../Common_Framework/LAMP.html">
            
                    
                        <b>1.8.2.</b>
                    
                    LAMP
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../Docker&K8s/">
            
                <a href="../Docker&K8s/">
            
                    
                        <b>1.9.</b>
                    
                    容器及容器编排
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../Docker&K8s/Docker/Docker.html">
            
                <a href="../Docker&K8s/Docker/Docker.html">
            
                    
                        <b>1.9.1.</b>
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1.1" data-path="../Docker&K8s/Docker/Docker.html">
            
                <a href="../Docker&K8s/Docker/Docker.html">
            
                    
                        <b>1.9.1.1.</b>
                    
                    Docker
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../Docker&K8s/K8s/">
            
                <a href="../Docker&K8s/K8s/">
            
                    
                        <b>1.9.2.</b>
                    
                    K8s
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.2.1" data-path="../Docker&K8s/K8s/K8s基础知识.html">
            
                <a href="../Docker&K8s/K8s/K8s基础知识.html">
            
                    
                        <b>1.9.2.1.</b>
                    
                    K8s基础知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2.2" data-path="../Docker&K8s/K8s/K8s安装与部署.html">
            
                <a href="../Docker&K8s/K8s/K8s安装与部署.html">
            
                    
                        <b>1.9.2.2.</b>
                    
                    K8s安装与部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../Git/">
            
                <a href="../Git/">
            
                    
                        <b>1.10.</b>
                    
                    Git
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../Git/Git基础.html">
            
                <a href="../Git/Git基础.html">
            
                    
                        <b>1.10.1.</b>
                    
                    Git基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../Git/GitLab服务器.html">
            
                <a href="../Git/GitLab服务器.html">
            
                    
                        <b>1.10.2.</b>
                    
                    GitLab服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../Windows/">
            
                <a href="../Windows/">
            
                    
                        <b>1.11.</b>
                    
                    Windows系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../Windows/cmd命令.html">
            
                <a href="../Windows/cmd命令.html">
            
                    
                        <b>1.11.1.</b>
                    
                    cmd命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../Vim.html">
            
                <a href="../Vim.html">
            
                    
                        <b>1.12.</b>
                    
                    Vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../i3WM快捷键.html">
            
                <a href="../i3WM快捷键.html">
            
                    
                        <b>1.13.</b>
                    
                    i3WM快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../ADB命令.html">
            
                <a href="../ADB命令.html">
            
                    
                        <b>1.14.</b>
                    
                    ADB命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../Tmux.html">
            
                <a href="../Tmux.html">
            
                    
                        <b>1.15.</b>
                    
                    Tmux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../Kindle.html">
            
                <a href="../Kindle.html">
            
                    
                        <b>1.16.</b>
                    
                    Kindle越狱指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../Other/">
            
                <a href="../Other/">
            
                    
                        <b>1.17.</b>
                    
                    Other
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../Other/pandoc.html">
            
                <a href="../Other/pandoc.html">
            
                    
                        <b>1.17.1.</b>
                    
                    pandoc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../Other/jupyter&reveal.js.html">
            
                <a href="../Other/jupyter&reveal.js.html">
            
                    
                        <b>1.17.2.</b>
                    
                    jupyter & reveal.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../Other/json.html">
            
                <a href="../Other/json.html">
            
                    
                        <b>1.17.3.</b>
                    
                    json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../Other/Reveal_js.html">
            
                <a href="../Other/Reveal_js.html">
            
                    
                        <b>1.17.4.</b>
                    
                    Reveal_js
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >DNS服务器</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#dns&#x8D44;&#x6E90;&#x7EAA;&#x5F55;resource-record">1. DNS&#x8D44;&#x6E90;&#x7EAA;&#x5F55;(Resource Record)</a></li><li><a href="#bindberkeley-internet-name-domain">2. BIND(Berkeley Internet Name Domain)</a></li><ul><li><a href="#bind&#x7684;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;">2.1. BIND&#x7684;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;</a></li></ul><li><a href="#&#x5176;&#x4ED6;">3. &#x5176;&#x4ED6;</a></li></ul></div><a href="#dns&#x8D44;&#x6E90;&#x7EAA;&#x5F55;resource-record" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><blockquote>
<p><strong>This is DNS&#x670D;&#x52A1;&#x5668; StudyNote.</strong></p>
</blockquote>
<h1 id="dns&#x8D44;&#x6E90;&#x7EAA;&#x5F55;resource-record"><a name="dns&#x8D44;&#x6E90;&#x7EAA;&#x5F55;resource-record" class="anchor-navigation-ex-anchor" href="#dns&#x8D44;&#x6E90;&#x7EAA;&#x5F55;resource-record"><i class="fa fa-link" aria-hidden="true"></i></a>1. DNS&#x8D44;&#x6E90;&#x7EAA;&#x5F55;(Resource Record)</h1>
<ul>
<li><p>&#x8D44;&#x6E90;&#x8BB0;&#x5F55;&#xFF0C;&#x7B80;&#x79F0;rr&#xFF0C;&#x5E38;&#x7528;&#x7684;&#x4E03;&#x5927;&#x8BB0;&#x5F55;&#x7C7B;&#x578B;&#x662F;&#xFF1A;<code>SOA</code>,<code>A</code>,<code>AAAA</code>,<code>PTR</code>,<code>MX</code>,<code>CNMAE</code>&#x548C;<code>NS</code></p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;<code>SOA</code>&#xFF1A;&#x540D;&#x53EB;&#x8D77;&#x59CB;&#x6388;&#x6743;&#x673A;&#x6784;&#x8BB0;&#x5F55;&#xFF0C;SOA&#x8BB0;&#x5F55;&#x8BF4;&#x660E;&#x4E86;&#x5728;&#x4F17;&#x591A;NS&#x8BB0;&#x5F55;&#x91CC;&#x90A3;&#x4E00;&#x53F0;&#x624D;&#x662F;&#x4E3B;&#x8981;&#x7684;&#x670D;&#x52A1;&#x5668;</p>
<p>&#xFF08;2&#xFF09;<code>A</code>&#xFF1A;&#x8BB0;&#x5F55;&#x9664;&#x4E86;&#x8FDB;&#x884C;&#x57DF;&#x540D;<strong>IPv4</strong>&#x5BF9;&#x5E94;&#x4EE5;&#x5916;&#xFF0C;&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x9AD8;&#x7EA7;&#x7528;&#x6CD5;&#xFF0C;&#x53EF;&#x4EE5;&#x4F5C;&#x4E3A;&#x4F4E;&#x6210;&#x672C;&#x7684;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7684;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#xFF0C;&#x540C;&#x4E00;&#x7AD9;&#x70B9;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x591A;&#x4E2A;A&#x8BB0;&#x5F55;&#xFF0C;&#x5BF9;&#x5E94;&#x591A;&#x53F0;&#x7269;&#x7406;&#x670D;&#x52A1;&#x5668;&#x7684;IP&#x5730;&#x5740;&#xFF0C;&#x53EF;&#x4EE5;&#x5B9E;&#x73B0;&#x57FA;&#x672C;&#x7684;&#x6D41;&#x91CF;&#x5747;&#x8861;</p>
<p>&#xFF08;3&#xFF09;<code>AAAA</code>&#xFF1A;&#x548C;<code>A</code>&#x8BB0;&#x5F55;&#x7C7B;&#x4F3C;&#xFF0C;&#x4F46;&#x91C7;&#x7528;<code>IPv6</code>&#x5730;&#x5740;&#x6765;&#x8BB0;&#x5F55;</p>
<p>&#xFF08;4&#xFF09;<code>PTR</code>&#xFF1A;PTR&#x8BB0;&#x5F55;&#x4E5F;&#x88AB;&#x79F0;&#x4E3A;&#x6307;&#x9488;&#x8BB0;&#x5F55;&#xFF0C;PTR&#x8BB0;&#x5F55;&#x662F;A&#x8BB0;&#x5F55;&#x7684;&#x9006;&#x5411;&#x8BB0;&#x5F55;&#xFF0C;&#x4F5C;&#x7528;&#x662F;&#x628A;IP&#x5730;&#x5740;&#x89E3;&#x6790;&#x4E3A;&#x57DF;&#x540D;</p>
<p>&#xFF08;5&#xFF09;<code>MX</code>&#xFF1A;&#x5168;&#x79F0;&#x662F;&#x90AE;&#x4EF6;&#x4EA4;&#x6362;&#x8BB0;&#x5F55;&#xFF0C;&#x5728;&#x4F7F;&#x7528;&#x90AE;&#x4EF6;&#x670D;&#x52A1;&#x5668;&#x7684;&#x65F6;&#x5019;&#xFF0C;MX&#x8BB0;&#x5F55;&#x662F;&#x65E0;&#x53EF;&#x6216;&#x7F3A;&#x7684;&#x3002;&#x4F18;&#x5148;&#x7EA7;&#xFF1A;0-99&#xFF0C;&#x6570;&#x5B57;&#x8D8A;&#x5C0F;&#x4F18;&#x5148;&#x7EA7;&#x8D8A;&#x9AD8;</p>
<p>&#xFF08;6&#xFF09;<code>CNMAE</code>&#xFF1A;&#x522B;&#x540D;&#x8BB0;&#x5F55;</p>
<p>&#xFF08;7&#xFF09;<code>NS</code>&#xFF1A;NS&#x8BB0;&#x5F55;&#x548C;SOA&#x8BB0;&#x5F55;&#x662F;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;DNS&#x533A;&#x57DF;&#x90FD;&#x4E0D;&#x53EF;&#x6216;&#x7F3A;&#x7684;&#x4E24;&#x6761;&#x8BB0;&#x5F55;&#xFF0C;NS&#x8BB0;&#x5F55;&#x4E5F;&#x53EB;&#x540D;&#x79F0;&#x670D;&#x52A1;&#x5668;&#x8BB0;&#x5F55;&#xFF0C;&#x7528;&#x4E8E;&#x8BF4;&#x660E;&#x8FD9;&#x4E2A;&#x533A;&#x57DF;&#x6709;&#x54EA;&#x4E9B;DNS&#x670D;&#x52A1;&#x5668;&#x8D1F;&#x8D23;&#x89E3;&#x6790;</p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x4E2A;&#x522B;&#x5E38;&#x7528;rr&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8BED;&#x6CD5;</p>
<ul>
<li><blockquote>
<ul>
<li>SOA</li>
</ul>
<pre class="language-"><code>ZONE_NAME   IN  SOA     nameserver.example.com.  example.email.com. (
20191010            ; serial number &#x533A;&#x57DF;&#x6570;&#x636E;&#x5E93;&#x7684;&#x5E8F;&#x5217;&#x53F7;&#xFF0C;&#x66F4;&#x65B0;&#x65F6;&#x4F7F;&#x7528;
3600 &lt;2H&gt;        ; refresh   [1h] &#x8868;&#x793A;slave dns&#x670D;&#x52A1;&#x5668;&#x627E;master dns&#x670D;&#x52A1;&#x5668;&#x66F4;&#x65B0;&#x533A;&#x57DF;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x7684;&#x65F6;&#x95F4;&#x95F4;&#x9694;
600 &lt;10M&gt;         ; retry   [10m] &#x8868;&#x793A;slave dns&#x670D;&#x52A1;&#x5668;&#x627E;master dns&#x670D;&#x52A1;&#x5668;&#x66F4;&#x65B0;&#x533A;&#x57DF;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x65F6;&#xFF0C;&#x5982;&#x679C;&#x8054;&#x7CFB;&#x4E0D;&#x4E0A;master&#xFF0C;&#x5219;&#x7B49;&#x5F85;&#x591A;&#x4E45;&#x518D;&#x91CD;&#x8BD5;&#x8054;&#x7CFB;&#xFF0C;&#x8BE5;&#x503C;&#x4E00;&#x822C;&#x6BD4;refresh&#x65F6;&#x95F4;&#x77ED;&#xFF0C;&#x5426;&#x5219;&#x8BE5;&#x503C;&#x8868;&#x793A;&#x7684;&#x91CD;&#x8BD5;&#x5C31;&#x5931;&#x53BB;&#x4E86;&#x610F;&#x4E49;
86400 &lt;1W&gt;        ; expire  [1d] &#x8868;&#x793A;slave dns&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x7684;&#x533A;&#x57DF;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x591A;&#x4E45;&#x8FC7;&#x671F;
3600 &lt;1D&gt;  )       ; min TTL   [1h] &#x8868;&#x793A;&#x5BA2;&#x6237;&#x7AEF;&#x627E;dns&#x670D;&#x52A1;&#x5668;&#x89E3;&#x6790;&#x65F6;&#xFF0C;&#x5426;&#x5B9A;&#x7B54;&#x6848;&#x7684;&#x7F13;&#x5B58;&#x65F6;&#x95F4;&#x957F;&#x5EA6;
</code></pre><ul>
<li>NS</li>
</ul>
<pre class="language-"><code class="lang-shell">example.com. TTL IN NS ns.example.com.
</code></pre>
<ul>
<li>PTR</li>
</ul>
<pre class="language-"><code class="lang-shell"><span class="token number">4.3</span>.2.1.in-addr.arpa.  IN PTR example.com.
</code></pre>
<ul>
<li>CNAME</li>
</ul>
<pre class="language-"><code class="lang-shell">web.example.com. IN CNAME www.example.com.
</code></pre>
<ul>
<li>MX</li>
</ul>
<pre class="language-"><code class="lang-shell">example.com.    IN     MX    <span class="token number">10</span>    mx1.example.com.
</code></pre>
<hr>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<p>&#xFF08;1&#xFF09;TTL&#x53EF;&#x4EE5;&#x4ECE;&#x5168;&#x5C40;&#x914D;&#x7F6E;&#x7EE7;&#x627F;</p>
<p>&#xFF08;2&#xFF09;@&#x8868;&#x793A;&#x5F53;&#x524D;&#x533A;&#x57DF;&#x540D;&#x79F0;</p>
<p>&#xFF08;3&#xFF09;&#x76F8;&#x90BB;&#x7684;&#x4E24;&#x6761;&#x8BB0;&#x5F55;&#x5176;ZONE_NAME&#x76F8;&#x540C;&#x65F6;&#xFF0C;&#x53EF;&#x4EE5;&#x7701;&#x7565;</p>
<p>&#xFF08;4&#xFF09;&#x5BF9;&#x4E8E;&#x6B63;&#x5411;&#x89E3;&#x6790;&#x533A;&#x57DF;&#x6765;&#x8BF4;&#xFF0C;&#x5404;&#x4E2A;MX&#x6216;&#x8005;NS&#x7B49;&#x7C7B;&#x578B;&#x8BB0;&#x5F55;&#x7684;&#x503C;&#x5E94;&#x8BE5;&#x4E3A;<code>FQDN</code>&#xFF0C;&#x5E76;&#x4E14;&#x6B64;FQDN&#x5E94;&#x8BE5;&#x6709;&#x4E00;&#x4E2A;A&#x8BB0;&#x5F55;</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<h1 id="bindberkeley-internet-name-domain"><a name="bindberkeley-internet-name-domain" class="anchor-navigation-ex-anchor" href="#bindberkeley-internet-name-domain"><i class="fa fa-link" aria-hidden="true"></i></a>2. BIND(Berkeley Internet Name Domain)</h1>
<ul>
<li><p>BIND&#x6240;&#x542B;&#x7A0B;&#x5E8F;&#x5305;</p>
<ul>
<li><blockquote>
<p>bind-libs&#xFF1A;&#x88AB;bind&#x7A0B;&#x5E8F;&#x548C;bind-utils&#x5305;&#x6240;&#x7528;&#x5230;&#x5E93;&#x6587;&#x4EF6;</p>
<p>bind-utils&#xFF1A;bind&#x5BA2;&#x6237;&#x7AEF;&#x7A0B;&#x5E8F;&#x96C6;&#xFF0C;&#x4F8B;&#x5982;<code>dig</code>&#xFF0C;<code>host</code>&#x548C;<code>nslookup</code>&#x7B49;</p>
<blockquote>
<p>&#x6269;&#x5C55;&#xFF1A;<code>dig</code>&#xFF0C;<code>host</code>&#xFF0C;<code>nslookup</code>&#x7684;&#x7B80;&#x5355;&#x4F7F;&#x7528;</p>
<p>&#x200B;            <code>dig</code>&#xFF1A;&#x4E13;&#x7528;&#x4E8E;&#x6D4B;&#x8BD5;dns&#x7CFB;&#x7EDF;&#xFF0C;&#x56E0;&#x6B64;&#x4E0D;&#x4F1A;&#x53BB;&#x67E5;&#x8BE2;&#x672C;&#x5730;hosts&#x6587;&#x4EF6;</p>
<p>&#x200B;                        &#x683C;&#x5F0F;&#x53CA;&#x9009;&#x9879;&#xFF1A;<code>dig [-t PR_TYPE] domain_name [@server] [options]</code>&#xFF0C;<code>-X</code>&#x53CD;&#x5411;&#x89E3;&#x6790;&#x6D4B;&#x8BD5;</p>
<p>&#x200B;                                        <code>+[no]trace</code>:&#x8DDF;&#x8E2A;&#x89E3;&#x6790;&#x8FC7;&#x7A0B;</p>
<p>&#x200B;                                        <code>+[no]recurse</code>:&#x8FDB;&#x884C;&#x9012;&#x5F52;&#x89E3;&#x6790;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">dig</span> -X <span class="token number">1.1</span>.1.1            <span class="token comment"># &#x53CD;&#x5411;&#x89E3;&#x6790;IP</span>
   <span class="token function">dig</span> -t afxr www.baidu.com @127.0.0.1
</code></pre>
<p>&#x200B;            <code>host</code>&#xFF1A;&#x683C;&#x5F0F;<code>host [-t PR_TYPE] name SERVER_IP</code></p>
<p>&#x200B;            <code>nslookup</code>&#xFF1A;&#x7528;&#x4E8E;&#x67E5;&#x8BE2;DNS&#x7684;&#x8BB0;&#x5F55;&#xFF0C;&#x67E5;&#x8BE2;&#x57DF;&#x540D;&#x89E3;&#x6790;&#x662F;&#x5426;&#x6B63;&#x5E38;</p>
<p>&#x200B;                        &#x683C;&#x5F0F;&#x53CA;&#x9009;&#x9879;&#xFF1A;<code>nslookup domain [dns-server]</code></p>
<pre class="language-"><code class="lang-bash"><span class="token comment"># &#x4EA4;&#x4E92;&#x5F0F;&#x6A21;&#x5F0F;&#x7684;&#x7B80;&#x5355;&#x4F7F;&#x7528;</span>
server IP            <span class="token comment"># &#x4EE5;&#x6307;&#x5B9A;IP&#x4E3A;DNS&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x884C;&#x67E5;&#x8BE2;</span>
<span class="token builtin class-name">set</span> <span class="token assign-left variable">q</span><span class="token operator">=</span>PR_TYPE        <span class="token comment"># &#x8981;&#x67E5;&#x8BE2;&#x7684;&#x8D44;&#x6E90;&#x7C7B;&#x578B;&#x8BB0;&#x5F55;</span>
name            <span class="token comment"># &#x8981;&#x67E5;&#x8BE2;&#x7684;&#x540D;&#x79F0;</span>
</code></pre>
<hr>
<p>bind&#x5185;&#x7F6E;&#x7684;<code>rndc</code>(named&#x670D;&#x52A1;&#x63A7;&#x5236;)&#x547D;&#x4EE4;&#xFF1A;</p>
<p>&#x200B;                        <code>rndc status</code></p>
<p>&#x200B;                        <code>rndc flush</code>            </p>
</blockquote>
<p>bind&#xFF1A;&#x63D0;&#x4F9B;dns&#x670D;&#x52A1;&#x7A0B;&#x5E8F;</p>
<p>bind-chroot&#xFF1A;&#x5C06;bind&#x8FD0;&#x884C;&#x4E8E;jail&#x73AF;&#x5883;&#x4E4B;&#x4E0B;</p>
</blockquote>
</li>
</ul>
</li>
<li><p><strong>&#x5B89;&#x88C5;bind</strong></p>
<ul>
<li><pre class="language-"><code class="lang-bash"><span class="token comment"># CentOS7&#x73AF;&#x5883;&#x4E0B;&#x5B89;&#x88C5;</span>
yum <span class="token function">install</span> <span class="token builtin class-name">bind</span>
</code></pre>
</li>
<li><p>&#x5B98;&#x7F51;&#x5730;&#x5740;&#xFF1A;<a href="https://www.isc.org/bind/" target="_blank">https://www.isc.org/bind/</a></p>
</li>
</ul>
</li>
<li><p>&#x4E3B;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF1A;<code>/etc/named.conf</code>&#xFF0C;bind&#x7684;&#x89E3;&#x6790;&#x5E93;&#x6587;&#x4EF6;&#x4E3A;<code>/var/named</code>&#x76EE;&#x5F55;&#x4E0B;&#x540E;&#x7F00;&#x540D;&#x4E3A;<code>.zone</code></p>
</li>
<li><p><code>rndc</code>(remote name domain contoller)&#xFF1A;&#x9ED8;&#x8BA4;&#x76D1;&#x542C;&#x7AEF;&#x53E3;953/tcp&#xFF0C;&#x9ED8;&#x8BA4;&#x53EA;&#x5141;&#x8BB8;&#x672C;&#x5730;&#x4F7F;&#x7528;</p>
</li>
<li><p><strong>&#x542F;&#x52A8;bind</strong>&#xFF1A;&#x4F7F;&#x7528;<code>systemctl start named.service</code>&#x5373;&#x53EF;</p>
</li>
<li><p>&#x914D;&#x7F6E;&#x89E3;&#x6790;&#x4E00;&#x4E2A;&#x6B63;&#x5411;&#x533A;&#x57DF;</p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x5B9A;&#x4E49;&#x533A;&#x57DF;</p>
<p>&#x200B;            &#x5728;&#x4E3B;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x6216;&#x8005;&#x8F85;&#x52A9;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x8BBE;&#x7F6E;</p>
<pre class="language-"><code class="lang-shell">zone <span class="token string">&quot;ZONE_NAME&quot;</span> IN<span class="token punctuation">{</span>
   <span class="token builtin class-name">type</span> <span class="token punctuation">{</span>master<span class="token operator">|</span>slave<span class="token operator">|</span>hint<span class="token operator">|</span>forward<span class="token punctuation">}</span>
   <span class="token function">file</span> <span class="token string">&quot;ZONENAME_FILE.zone&quot;</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#xFF08;2&#xFF09;&#x5EFA;&#x7ACB;&#x533A;&#x57DF;&#x6570;&#x636E;&#x6587;&#x4EF6;</p>
<p>&#x200B;            &#x5728;<code>/var/named</code>&#x76EE;&#x5F55;&#x4E0B;&#x5EFA;&#x7ACB;&#x76F8;&#x5E94;&#x7684;&#x533A;&#x57DF;&#x6570;&#x636E;&#x6587;&#x4EF6;&#xFF0C;&#x6587;&#x4EF6;&#x540D;&#x79F0;&#x4E3A;<code>/var/named/ictw.top.zone</code></p>
<pre class="language-"><code class="lang-shell"><span class="token variable">$TTL</span> <span class="token number">3600</span>
<span class="token variable">$ORIGIN</span> ictw.top.
@    IN    SOA    ns1.ictw.top.    ictw.qq.com. <span class="token punctuation">(</span>
       <span class="token number">20191023</span>
       1H
       10M
       3D
       1D <span class="token punctuation">)</span>
   IN    NS    ns1
   IN    MX    <span class="token number">10</span> mx1
ns1    IN    A    <span class="token number">172.16</span>.122.128
mx1    IN    A    <span class="token number">172.16</span>.122.129
www    IN    A    <span class="token number">172.16</span>.122.128
web    IN    A    <span class="token number">172.16</span>.122.128
</code></pre>
<p>&#xFF08;3&#xFF09;&#x6743;&#x9650;&#x4FEE;&#x6539;&#x4EE5;&#x53CA;&#x8BED;&#x6CD5;&#x9519;&#x8BEF;&#x68C0;&#x6D4B;</p>
<pre class="language-"><code class="lang-bash"><span class="token comment"># &#x4FEE;&#x6539;&#x533A;&#x57DF;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x6743;&#x9650;</span>
<span class="token function">chgrp</span> named /var/named/ictw.zone
<span class="token function">chmod</span> <span class="token assign-left variable">o</span><span class="token operator">=</span> /var/named/ictw.zone
<span class="token comment"># &#x6216;&#x8005;&#x590D;&#x5236;named.localhost&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x8FDB;&#x884C;&#x4FEE;&#x6539;</span>
<span class="token function">cp</span> -a named.localhost ictw.zone

<span class="token comment"># &#x8BED;&#x6CD5;&#x9519;&#x8BEF;&#x68C0;&#x6D4B;</span>
named-checkzone ZONE_NAME ZONE_FILE
</code></pre>
<p>&#xFF08;4&#xFF09;&#x8BA9;dns&#x670D;&#x52A1;&#x5668;&#x91CD;&#x8BFB;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x548C;&#x533A;&#x57DF;&#x6570;&#x636E;&#x5E93;&#x6587;&#x4EF6;</p>
<pre class="language-"><code class="lang-bash">rndc reload
<span class="token comment"># &#x6216;&#x8005;</span>
systemctl reload named.service

<span class="token comment"># &#x67E5;&#x770B;bind&#x72B6;&#x6001;</span>
rndc status
</code></pre>
<p>&#xFF08;5&#xFF09;&#x4F7F;&#x7528;<code>dig -t axfr ictw.top @127.0.0.1</code>&#x6216;&#x8005;<code>host -t axfr ictw.top 127.0.0.1</code>&#x68C0;&#x67E5;&#x662F;&#x5426;&#x6210;&#x529F;&#x8FD0;&#x4F5C;</p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x914D;&#x7F6E;&#x53CD;&#x5411;&#x89E3;&#x6790;&#x533A;&#x57DF;</p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x7F16;&#x8F91;<code>/etc/named.rfc1912.zones</code>&#x6587;&#x4EF6;&#x6DFB;&#x52A0;&#x53CD;&#x5411;&#x89E3;&#x6790;&#x533A;&#x57DF;</p>
<pre class="language-"><code class="lang-shell">zone <span class="token string">&quot;122.16.172.in-addr.arpa&quot;</span> IN <span class="token punctuation">{</span>
  <span class="token builtin class-name">type</span> master<span class="token punctuation">;</span>
  <span class="token function">file</span> <span class="token string">&quot;122.16.172.zone&quot;</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<p>&#xFF08;2&#xFF09;&#x5EFA;&#x7ACB;&#x533A;&#x57DF;&#x6570;&#x636E;&#x5E93;&#x6587;&#x4EF6;&#xFF0C;&#x6587;&#x4EF6;&#x4E3A;<code>/var/named/122.16.172.zone</code></p>
<pre class="language-"><code class="lang-shell"><span class="token variable">$TTL</span> <span class="token number">3600</span>
<span class="token variable">$ORIGIN</span> <span class="token number">122.16</span>.172.in-addr.arpa.
@    IN    SOA    ns1.ictw.top.    ictw.qq.com. <span class="token punctuation">(</span>
       <span class="token number">20191023</span>
       1H
       10M
       3D
       1D <span class="token punctuation">)</span>
   IN    NS    ns1.ictw.top.
<span class="token number">130</span>    IN    PTR    blog.ictw.top.
<span class="token number">141</span>    IN    PTR    test.ictw.top.
</code></pre>
<p>&#xFF08;3&#xFF09;&#x68C0;&#x67E5;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5E76;&#x91CD;&#x8BFB;</p>
<pre class="language-"><code class="lang-bash">named-checkconf
named-chekzone ZONE_NAME FILE_NAME

rndc reload
</code></pre>
<p>&#xFF08;4&#xFF09;&#x6D4B;&#x8BD5;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">dig</span> -x <span class="token number">172.16</span>.122.130 @127.0.0.1
</code></pre>
</blockquote>
</li>
</ul>
</li>
</ul>
<h2 id="bind&#x7684;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;"><a name="bind&#x7684;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;" class="anchor-navigation-ex-anchor" href="#bind&#x7684;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;"><i class="fa fa-link" aria-hidden="true"></i></a>2.1. BIND&#x7684;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;</h2>
<ul>
<li><p><strong>&#x4E3B;&#x4ECE;DNS</strong></p>
<ul>
<li><blockquote>
<p><strong>&#x5728;&#x4ECE;DNS&#x670D;&#x52A1;&#x5668;&#x4E0A;</strong></p>
<p>&#xFF08;1&#xFF09;&#x914D;&#x7F6E;&#x4E00;&#x4E2A;&#x6B63;&#x5411;&#x4ECE;&#x533A;&#x57DF;&#xFF0C;&#x653E;&#x7F6E;&#x4E8E;<code>/etc/named.rfc1912.zones</code></p>
<pre class="language-"><code class="lang-shell">zone <span class="token string">&quot;ZONE_NAME&quot;</span> IN <span class="token punctuation">{</span>
   <span class="token builtin class-name">type</span> slave<span class="token punctuation">;</span>
   <span class="token function">file</span> <span class="token string">&quot;slaves/ZONE_NAME.zone&quot;</span><span class="token punctuation">;</span>
   masters <span class="token punctuation">{</span> MASTER_IP<span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<p>&#xFF08;2&#xFF09;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8BED;&#x6CD5;&#x68C0;&#x67E5;<code>named-checkconf</code></p>
<p>&#xFF08;3&#xFF09;&#x91CD;&#x8F7D;&#x914D;&#x7F6E;<code>rndc reload</code></p>
<p><strong>&#x5728;&#x4E3B;DNS&#x670D;&#x52A1;&#x5668;&#x4E0A;</strong></p>
<p>&#xFF08;1&#xFF09;&#x7F16;&#x8F91;<code>/etc/named/ictw.top.zone</code>&#x6587;&#x4EF6;&#xFF0C;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;<code>NS</code>&#x8BB0;&#x5F55;&#xFF0C;&#x5E76;&#x6307;&#x5B9A;&#x5176;IP&#x5730;&#x5740;</p>
<pre class="language-"><code class="lang-shell"><span class="token punctuation">..</span>.
   IN      NS      ns2
ns2     IN      A       <span class="token number">172.16</span>.122.132
<span class="token punctuation">..</span>.
</code></pre>
<p>&#xFF08;2&#xFF09;&#x4FEE;&#x6539;serial&#x53F7;&#x540E;&#xFF0C;&#x91CD;&#x8F7D;&#x914D;&#x7F6E;<code>rndc reload</code>&#x5373;&#x53EF;</p>
<hr>
<p>&#x53CD;&#x5411;&#x89E3;&#x6790;&#x4E5F;&#x662F;&#x5982;&#x6B64;.</p>
</blockquote>
</li>
</ul>
</li>
<li><p><strong>&#x5B50;&#x57DF;&#x6388;&#x6743;</strong></p>
<ul>
<li><blockquote>
<p><strong>&#x5728;&#x4E3B;&#x670D;&#x52A1;&#x5668;&#x4E0A;</strong></p>
<p>&#xFF08;1&#xFF09;&#x7F16;&#x8F91;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x5B50;&#x57DF;&#xFF0C;&#x4F8B;&#x5982;</p>
<pre class="language-"><code class="lang-shell"><span class="token punctuation">..</span>.
child.ictw.top.    IN    NS    ns2.ictw.top.
ns2.ictw.top.    IN    A    <span class="token number">172.16</span>.122.132
<span class="token punctuation">..</span>.
</code></pre>
<p>&#x5728;&#x5B50;&#x57DF;&#x670D;&#x52A1;&#x5668;&#x4E0A;</p>
<p>&#xFF08;1&#xFF09;&#x7F16;&#x8F91;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x6DFB;&#x52A0;&#x89E3;&#x6790;&#x57DF;</p>
<pre class="language-"><code class="lang-shell">zone <span class="token string">&quot;child.ictw.top&quot;</span> IN <span class="token punctuation">{</span>
       <span class="token builtin class-name">type</span> master<span class="token punctuation">;</span>
       <span class="token function">file</span> <span class="token string">&quot;child.ictw.top.zone&quot;</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<p>&#xFF08;2&#xFF09;&#x7F16;&#x8F91;&#x57DF;&#x6587;&#x4EF6;<code>child.ictw.top.zone</code></p>
<pre class="language-"><code class="lang-shell"><span class="token variable">$TTL</span> <span class="token number">3600</span>
<span class="token variable">$ORIGIN</span> child.ictw.top.
@       IN      SOA     ns1.ictw.top.   ictw.qq.com. <span class="token punctuation">(</span>
               <span class="token number">20191023</span>
               1H
               10M
               3D
               1D <span class="token punctuation">)</span>
       IN      NS      ns1
ns1     IN      A       <span class="token number">172.16</span>.122.132
www     IN      A       <span class="token number">172.16</span>.122.123
</code></pre>
<p>&#xFF08;3&#xFF09;<code>rndc reload</code>&#xFF0C;&#x5206;&#x522B;&#x5728;&#x4E3B;&#x670D;&#x52A1;&#x5668;&#x548C;&#x5B50;&#x57DF;&#x670D;&#x52A1;&#x533A;&#x8FDB;&#x884C;&#x6D4B;&#x8BD5;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">dig</span> -t A www.child.ictw.top @127.0.0.1
</code></pre>
</blockquote>
</li>
<li><p>&#x5B9A;&#x4E49;&#x8F6C;&#x53D1;</p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x533A;&#x57DF;&#x8F6C;&#x53D1;&#xFF1A;&#x4EC5;&#x8F6C;&#x53D1;&#x5BF9;&#x67D0;&#x7279;&#x5B9A;&#x533A;&#x57DF;&#x7684;&#x89E3;&#x6790;&#x8BF7;&#x6C42;</p>
<pre class="language-"><code class="lang-shell">zone <span class="token string">&quot;ZONE_NAME&quot;</span> IN <span class="token punctuation">{</span>
   <span class="token builtin class-name">type</span> forward<span class="token punctuation">;</span>
   forward <span class="token punctuation">{</span>first <span class="token operator">|</span> only<span class="token punctuation">}</span><span class="token punctuation">;</span>
   forwarders <span class="token punctuation">{</span> SERVER_IP<span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<blockquote>
<p><code>first</code> &#x548C; <code>only</code> &#x8F6C;&#x53D1;&#x65B9;&#x5F0F;&#x7684;&#x533A;&#x522B;&#xFF1A;</p>
<p>&#x200B;            &#x524D;&#x8005;&#x4E3A;&#x9996;&#x5148;&#x8F6C;&#x53D1;&#xFF0C;&#x8F6C;&#x53D1;&#x5668;&#x4E0D;&#x54CD;&#x5E94;&#x65F6;&#xFF0C;&#x81EA;&#x884C;&#x4F1A;&#x53BB;&#x8FED;&#x4EE3;&#x67E5;&#x8BE2;</p>
<p>&#x200B;            &#x540E;&#x8005;&#x53EA;&#x8F6C;&#x53D1;&#xFF0C;&#x4E0D;&#x4F1A;&#x53BB;&#x8FED;&#x4EE3;&#x67E5;&#x8BE2;</p>
</blockquote>
<p>&#xFF08;2&#xFF09;&#x5168;&#x5C40;&#x8F6C;&#x53D1;&#xFF1A;&#x5C06;&#x81EA;&#x5DF1;&#x65E0;&#x6CD5;&#x89E3;&#x6790;&#x7684;zone&#xFF0C;&#x7EDF;&#x7EDF;&#x8F6C;&#x53D1;&#x7ED9;&#x6307;&#x5B9A;dns&#x670D;&#x52A1;&#x5668;&#x6765;&#x89E3;&#x6790;</p>
<pre class="language-"><code class="lang-shell"><span class="token comment"># &#x4FEE;&#x6539;&#x6307;&#x5B9A;dns&#x670D;&#x52A1;&#x5668;&#x7684;/etc/named.conf&#x6587;&#x4EF6;&#xFF0C;&#x6DFB;&#x52A0;&#x4EE5;&#x4E0B;&#x53C2;&#x6570;</span>
forward only<span class="token punctuation">;</span>
forwarders <span class="token punctuation">{</span> <span class="token number">172.16</span>.122.128<span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
</blockquote>
</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>bind&#x4E2D;&#x7684;&#x57FA;&#x7840;&#x5B89;&#x5168;&#x914D;&#x7F6E;</strong></p>
<blockquote>
<p>&#xFF08;1&#xFF09;acl&#x8BBF;&#x95EE;&#x63A7;&#x5236;&#xFF08;&#x5199;&#x5728;options&#x9009;&#x9879;&#x4E4B;&#x524D;&#xFF09;&#xFF1A;</p>
<pre class="language-"><code class="lang-shell">acl acl_name <span class="token punctuation">{</span>
   <span class="token function">ip</span><span class="token punctuation">;</span>
   net/netmask<span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
opinions<span class="token punctuation">{</span>
<span class="token punctuation">..</span>.
<span class="token punctuation">}</span>
</code></pre>
<p>acl&#x7684;&#x56DB;&#x4E2A;&#x5185;&#x7F6E;&#x53C2;&#x6570;&#xFF1A;</p>
<p>&#x200B;        <code>none</code>&#xFF0C;<code>any</code>&#xFF0C;<code>local</code>&#xFF0C;<code>localnet</code>&#xFF08;&#x672C;&#x673A;&#x6240;&#x5728;&#x7F51;&#x7EDC;&#xFF09;</p>
<p>&#xFF08;2&#xFF09;&#x8BBF;&#x95EE;&#x63A7;&#x5236;&#xFF08;&#x7F6E;&#x4E8E;&#x533A;&#x57DF;&#x6570;&#x636E;&#x4E2D;&#xFF09;</p>
<p><code>allow-query {   };</code>&#xFF1A;&#x5141;&#x8BB8;&#x67E5;&#x8BE2;&#x7684;&#x4E3B;&#x673A;&#xFF0C;&#x767D;&#x540D;&#x5355;&#x6A21;&#x5F0F;</p>
<p><code>allow-transfer {    };</code>&#xFF1A;&#x5141;&#x8BB8;&#x5411;&#x90A3;&#x4E9B;&#x4E3B;&#x673A;&#x533A;&#x57DF;&#x8FDB;&#x884C;&#x4F20;&#x9001;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;&#x6240;&#x6709;&#x4E3B;&#x673A;&#xFF0C;&#x4E00;&#x822C;&#x914D;&#x7F6E;&#x4E8E;&#x4ECE;&#x670D;&#x52A1;&#x5668;</p>
<p><code>allow-recursion{   };</code>(opinions&#x4E2D;&#x4F7F;&#x7528;)&#xFF1A;&#x5141;&#x8BB8;&#x54EA;&#x4E9B;&#x4E3B;&#x673A;&#x5411;&#x5F53;&#x524D;dns&#x670D;&#x52A1;&#x5668;&#x53D1;&#x8D77;&#x9012;&#x5F52;&#x67E5;&#x8BE2;&#x8BF7;&#x6C42;</p>
<p><code>allow-update{    };</code>&#xFF1A;&#x7528;&#x4E8E;DDNS&#xFF0C;&#x4E00;&#x822C;&#x7981;&#x7528;&#x8BE5;&#x9009;&#x9879;&#xFF0C;&#x8D4B;&#x4E88;<code>none</code>&#x503C;</p>
</blockquote>
</li>
<li><p><strong>&#x667A;&#x80FD;DNS</strong>&#xFF08;BIND View&#xFF09;&#xFF1A;&#x5185;&#x5916;&#x7F51;&#x5206;&#x6D41;</p>
<ul>
<li><blockquote>
<p>&#x683C;&#x5F0F;&#xFF1A;</p>
<pre class="language-"><code class="lang-shell">view VIEW_NAME <span class="token punctuation">{</span>
   zone_name<span class="token punctuation">{</span>
   <span class="token punctuation">..</span>.
   <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<p>&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre class="language-"><code class="lang-shell"><span class="token comment"># &#x5185;&#x7F51;</span>
view Internal <span class="token punctuation">{</span>
   match-clients <span class="token punctuation">{</span> <span class="token number">172.16</span>.122.0/8<span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>        <span class="token comment"># &#x6240;&#x5339;&#x914D;&#x5230;&#x7684;&#x7F51;&#x7EDC;</span>
   zone <span class="token string">&quot;ictw.top&quot;</span> IN <span class="token punctuation">{</span>
       <span class="token builtin class-name">type</span> master<span class="token punctuation">;</span>
       <span class="token function">file</span> <span class="token string">&quot;ictw.top/internal&quot;</span><span class="token punctuation">;</span>
   <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment"># &#x5916;&#x7F51;</span>
view external <span class="token punctuation">{</span>
   match-clients <span class="token punctuation">{</span> any<span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
   zone <span class="token string">&quot;ictw.top&quot;</span> IN <span class="token punctuation">{</span>
       <span class="token builtin class-name">type</span> master<span class="token punctuation">;</span>
       <span class="token function">file</span> <span class="token string">&quot;ictw.top/external&quot;</span><span class="token punctuation">;</span>
   <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
</blockquote>
</li>
</ul>
</li>
</ul>
<h1 id="&#x5176;&#x4ED6;"><a name="&#x5176;&#x4ED6;" class="anchor-navigation-ex-anchor" href="#&#x5176;&#x4ED6;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x5176;&#x4ED6;</h1>
<hr>
<ol>
<li><p>&#x89E3;&#x51B3;&#x4E00;&#x5806;<code>SERVFAIL unexpected RCODE resolving &apos;./NS/IN&apos;: 199.9.14.201#53</code>&#x7684;&#x95EE;&#x9898;</p>
<blockquote>
<p>&#x7F16;&#x8F91;bind&#x7684;&#x4E3B;&#x914D;&#x7F6E;&#x6587;&#x4EF6;<code>/etc/named.conf</code>&#xFF0C;&#x5C06;<code>logging</code>&#x53C2;&#x6570;&#x4FEE;&#x6539;&#x4E3A;</p>
<pre class="language-"><code class="lang-shell">logging <span class="token punctuation">{</span>
       category lame-servers <span class="token punctuation">{</span> null<span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<p>&#x91CD;&#x542F;named&#x5373;&#x53EF;</p>
</blockquote>
</li>
<li><p><code>whois</code>&#x547D;&#x4EE4;&#x7684;&#x7B80;&#x5355;&#x4F7F;&#x7528;<code>whois Domian_name</code> </p>
</li>
</ol>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; AGou 2020 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-03-02 20:42:24
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="OpenSSL、PKI搭建、算法.html" class="navigation navigation-prev " aria-label="Previous page: OpenSSL、PKI搭建">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Frp内网穿透.html" class="navigation navigation-next " aria-label="Next page: Frp内网穿透">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"DNS服务器","level":"1.4.16","depth":2,"next":{"title":"Frp内网穿透","level":"1.4.17","depth":2,"path":"Linux/Frp内网穿透.md","ref":"Linux/Frp内网穿透.md","articles":[]},"previous":{"title":"OpenSSL、PKI搭建","level":"1.4.15","depth":2,"path":"Linux/OpenSSL、PKI搭建、算法.md","ref":"Linux/OpenSSL、PKI搭建、算法.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github@^2.0.0","edit-link@^2.0.2","anchors@^0.7.1","include-codeblock@^3.0.2","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","anchor-navigation-ex@0.1.8","prism","-highlight","insert-logo","-lunr","-search","search-pro","splitter","lightbox","github-buttons","-sharing","sharing-plus","donate","code","-klipse","livereload"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © AGou 2020","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"github":{"url":"https://github.com/AGou-ops"},"livereload":{},"splitter":{},"search-pro":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"code":{"copyButtons":true},"donate":{"alipay":"https://agou-ops.github.io/images/alipay.png","alipayText":"支付宝打赏","button":"打赏","title":"","wechat":"https://agou-ops.github.io/images/wechatpay.png","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"anchor-navigation-ex":{"isRewritePageTitle":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"lightbox":{"jquery":true,"sameUuid":false},"github-buttons":{"repo":"AGou-ops/myStudyNote","types":["star","watch","fork"],"size":"small"},"expandable-chapters-small":{},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":true,"all":["douban","facebook","google","hatenaBookmark","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","vk","weibo","pocket","stumbleupon","whatsapp"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"edit-link":{"label":"Edit This Page","base":"https://github.com/AGou-ops/myStudyNote"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"insert-logo":{"style":"background: none; max-height: 50px; min-height: 50px","url":"https://s2.ax1x.com/2019/12/10/QBD0xO.jpg"}},"theme":"default","author":"AGou","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"AGou's StudyNote","language":"zh-hans","output.name":"site","links":{"sidebar":{"◆点击进入我的个人博客":"http://agou-ops.github.io"}},"gitbook":"3.2.3","description":"岂能尽如人意，但求无愧我心。"},"file":{"path":"Linux/DNS服务器.md","mtime":"2020-03-02T12:42:24.288Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-02T12:42:32.383Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

